package com.dsg.entity.account;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 油公司總帳明細
 * </p>
 *
 * @author system
 * @since 2020-07-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("dsg_account_ledger")
@ApiModel(value = "DsgAccountLedger对象", description = "油公司總帳明細")
public class DsgAccountLedger implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId("OID")
    private String oid;

    @ApiModelProperty(value = "油公司日結帳ID")
    @TableField("PID")
    private String pid;

    @ApiModelProperty(value = "記帳方式")
    @TableField("ACC_MODE")
    private Integer accMode;

    @ApiModelProperty(value = "客戶編碼")
    @TableField("CUS_CODE")
    private String cusCode;

    @ApiModelProperty(value = "收/支款人編號")
    @TableField("IN_EXP_CODE")
    private String inExpCode;

    @ApiModelProperty(value = "收/支款人名稱")
    @TableField("IN_EXP_NAME")
    private String inExpName;

    @ApiModelProperty(value = "油公司編號")
    @TableField("OIL_COM")
    private String oilCom;

    @ApiModelProperty(value = "收/支帳號")
    @TableField("ACCOUNT_CODE")
    private String accountCode;

    @ApiModelProperty(value = "收/支帳號名稱")
    @TableField("ACCOUNT_NAME")
    private String accountName;

    @ApiModelProperty(value = "交易專案")
    @TableField("TRAN_ITEM")
    private Integer tranItem;

    @ApiModelProperty(value = "收入")
    @TableField("IN_AMOUNT")
    private BigDecimal inAmount;

    @ApiModelProperty(value = "支出")
    @TableField("OUT_AMOUNT")
    private BigDecimal outAmount;

    @ApiModelProperty(value = "支票號")
    @TableField("CHECK_NO")
    private String checkNo;

    @ApiModelProperty(value = "交易時間")
    @TableField("TRAN_TIME")
    private Date tranTime;

    @ApiModelProperty(value = "兌現時間")
    @TableField("CASH_TIME")
    private Date cashTime;

    @ApiModelProperty(value = "預計兌現日期")
    @TableField("PRE_TIME")
    private Date preTime;

    @ApiModelProperty(value = "是否記入統計")
    @TableField("INCLUDE_IN")
    private Integer includeIn;

    @ApiModelProperty(value = "對賬狀態")
    @TableField("REC_STATUS")
    private Integer recStatus;

    @ApiModelProperty(value = "備註")
    @TableField("REMARKS")
    private String remarks;

    /**
     * 企業編號
     */
    @TableField(value = "ENT_CODE")
    @ApiModelProperty(value = "企業編號", name = "entCode")
    private String entCode;

    @ApiModelProperty(value = "创建人")
    @TableField("CREATER")
    private String creater;

    @ApiModelProperty(value = "创建时间")
    @TableField("CREATE_TIME")
    private Date createTime;

    @ApiModelProperty(value = "更新人")
    @TableField("UPDATER")
    private String updater;

    @ApiModelProperty(value = "更新时间")
    @TableField("UPDATE_TIME")
    private Date updateTime;

    /************************查詢條件**********************/
    @ApiModelProperty(value = "創建日期開始")
    @TableField(exist = false)
    private String createTimeStart;

    @ApiModelProperty(value = "創建日期結束")
    @TableField(exist = false)
    private String createTimeEnd;

    @ApiModelProperty(value = "交易日期開始")
    @TableField(exist = false)
    private String tranTimeStart;

    @ApiModelProperty(value = "交易日期結束")
    @TableField(exist = false)
    private String tranTimeEnd;

    @ApiModelProperty(value = "兌日期開始")
    @TableField(exist = false)
    private String cashTimeStart;

    @ApiModelProperty(value = "兌日期結束")
    @TableField(exist = false)
    private String cashTimeEnd;

    @ApiModelProperty(value = "是否已兌 1:已兌 2:未兌")
    @TableField(exist = false)
    private String isCash;

    /************************支票屬性**********************/
    @ApiModelProperty(value = "支票金額")
    @TableField(exist = false)
    private BigDecimal checkSum;

    @ApiModelProperty(value = "油公司總帳明細集合")
    private List<DsgAccountLedger> dsgAccountLedgerList;

    /************************枚舉**********************/
    public enum AppStatus {
        temporary(0), already(1),
        oilIn(1), discount(2), administration(3), giveBack(4), oilCard(5), account(6),
        automaticPayment(7), autoTransferFailed(8), check(9), cash(10), checkBounce(11),
        notCounting(0), included(1),
        suspenseAccount(0), noReconciliation(1), reconciled(2), ArReconciliation(3);
        Integer code;

        AppStatus(int code) {
            this.code = code;
        }

        public Integer getCode() {
            return code;
        }
    }
}
